{% extends '@WebsiteBundle/layout/layout.html.twig' %}
 {% block page %}
   {{ parent() }}
<div id="main" class="commonMain">
  <div class="layui-fluid" style="background-color: #393D49">
    <div class="layui-main detailHeadTest">
      <div class="header">
              <span class="layui-breadcrumb">
              <a href="/">首页</a>
              <a href="{{ path('qa_exam_index', {categoryId:info['categoryId']}) }}">试卷中心</a>
              <a><cite>{{ info['name'] }}</cite></a>
              </span>
      </div>
      <div class="body">
        {% if info["isGroup"] == 0 %}
          <div class="layui-row layui-col-space20">
            <div class="layui-col-md12">
              <div class="info">
                <div class="title">{{ info['name'] }}</div>
                <div class="attr layui-row">
                  <div class="layui-col-md3 price">价格:  <span class="fontColorRed">{% if info['shopPrice']==0 %}免费{% else %}¥{{ info['shopPriceView'] }}{% endif %}</span></div>
                  <div class="layui-col-md3 viewNum">购买人数: {{ info['buyNumberFalse'] }} 人</div>
                </div>
              </div>
              <div class="infoFooter">
                <ul>
                  <li class="left">
                    {% if info['shopPrice']==0 %}
                      <a href="{{ path('app_order_tobuy', {'uuid':info['uuid']}) }}" class="layui-btn layui-btn-danger layui-btn-lg">免费获取</a>
                    {% else %}
                      <a  href="{{ path('app_order_tobuy', {'uuid':info['uuid']}) }}" class="layui-btn layui-btn-danger layui-btn-lg">立即购买</a>
                    {% endif %}
                  </li>
                </ul>
              </div>
            </div>
          </div>
        {% else %}
          {#              组合商品可选#}
          {% if info["groupType"] == 1 %}
            <form action="{{ path('app_order_tobuy', {'uuid':info['uuid']}) }}" method="get" class="layui-form">
              <div class="layui-row layui-col-space20">
                <div class="layui-col-md12">
                  <div class="info">
                    <div class="title">{{ info['name'] }}</div>
                    {% if info['level'] == 0 %}
                      <div class="goodsList">
                        {% if info['childGoods'] %}
                          <ul class="selectArea">
                            {% for key2, item2 in info['childGoods'] %}
                              <li>
                                <input type="checkbox" value="{{ item2['id'] }}" name="goodsId[]" title="{{ item2['name'] }}" {% if key2==0 %} checked {% endif %} />
                              </li>
                            {% endfor %}
                          </ul>
                        {% endif %}
                      </div>
                    {% else %}
                      {% if info['childGoods'] %}
                        {% for key1, item1 in info['childGoods'] %}
                          <div class="goodsList">
                            <div class="goodsListTitle">{{ item1['name'] }}</div>
                            <ul class="selectArea">
                              {% for key2, item2 in item1['childGoods'] %}
                                <li>
                                  <input type="checkbox" value="{{ item2['id'] }}" {% if key2==0 %} checked {% endif %} title="{{ item2['name'] }}"  name="goodsId[]" />
                                </li>
                              {% endfor %}
                            </ul>
                          </div>
                        {% endfor %}
                      {% endif %}
                    {% endif %}
                    <div class="attr layui-row">
                      <div class="layui-col-md3 price">价格:  <span class="fontColorRed">{% if info['shopPrice']==0 %}免费{% else %}¥{{ info['shopPriceView'] }}{% endif %}</span></div>
                      <div class="layui-col-md3 viewNum">购买人数: {{ info['buyNumberFalse'] }} 人</div>
                    </div>
                  </div>
                  <div class="infoFooter">
                    <ul>
                      <li class="left">
                        {% if info['shopPrice']==0 %}
                          <a href="{{ path('app_order_tobuy', {'uuid':info['uuid']}) }}" class="layui-btn layui-btn-danger layui-btn-lg" id="tobuy">免费获取</a>
                        {% else %}
                          <a  href="{{ path('app_order_tobuy', {'uuid':info['uuid']}) }}" class="layui-btn layui-btn-danger layui-btn-lg"  id="tobuy">立即购买</a>
                        {% endif %}
                      </li>
                    </ul>
                  </div>
                </div>
              </div>
            </form>
          {% else %}
            {#              组合商品全选#}
            <div class="layui-row layui-col-space20">
              <div class="layui-col-md12">
                <div class="info">
                  <div class="title">{{ info['name'] }}</div>
                  <div class="attr layui-row">
                    <div class="layui-col-md3 price">价格:  <span class="fontColorRed">{% if info['shopPrice']==0 %}免费{% else %}¥{{ info['shopPriceView'] }}{% endif %}</span></div>
                    <div class="layui-col-md3 viewNum">购买人数: {{ info['buyNumberFalse'] }} 人</div>
                  </div>
                </div>
                <div class="infoFooter">
                  <ul>
                    <li class="left">
                      {% if info['shopPrice']==0 %}
                        <a href="{{ path('app_order_tobuy', {'uuid':info['uuid']}) }}" class="layui-btn layui-btn-danger layui-btn-lg">免费获取</a>
                      {% else %}
                        <a  href="{{ path('app_order_tobuy', {'uuid':info['uuid']}) }}" class="layui-btn layui-btn-danger layui-btn-lg">立即购买</a>
                      {% endif %}
                    </li>
                  </ul>
                </div>
              </div>
            </div>
          {% endif %}
        {% endif %}
      </div>
    </div>

    <div class="layui-main detailBody">
      <div class="layui-row">
        <div class="layui-col-md8">
          <div class="wrap">
            <div class="content">
              <div class="layui-tab layui-tab-brief">
                <ul class="layui-tab-title">
                  <li class="layui-this">试卷介绍</li>
                  <li>咨询</li>
                </ul>
                <div class="layui-tab-content">
                  <div class="layui-tab-item layui-show">
                    {% if info['introduce'] %}
                      {{ info['introduce']['content']|raw }}
                    {% else %}
                      <div class="layui-center">
                        <div><img src="/bundles/eduxpluswebsite/default/images/null-i2.png"  class="blank-img" /></div>
                        <div>还没有当前试卷的介绍哦～</div>
                      </div>
                    {% endif %}
                  </div>
                  <div class="layui-tab-item">咨询</div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="layui-col-md4">

        </div>
      </div>
    </div>

  </div>
</div>
 {% endblock %}
